//
// Time.cpp for  in /home/lund/Projets/pizzaillo
// 
// Made by florian dewulf
// Login   <dewulf_f@epitech.net>
// 
// Started on  Mon Apr 15 14:47:40 2013 florian dewulf
// Last update Mon Apr 15 15:56:54 2013 florian dewulf
//

#include	"Time.hpp"

Time::Time() : _time_begin(0), _time_end(0)
{
}

Time::~Time()
{
}

void	Time::start()
{
  struct timeval	t;

  gettimeofday(&t, NULL);
  this->_time_begin = t.tv_usec;
}

void	Time::stop()
{
  struct timeval	t;

  gettimeofday(&t, NULL);
  this->_time_end = t.tv_usec;
}

u_int	Time::diff() const
{
  return (this->_time_end - this->_time_begin);
}

void	Time::reset()
{
  this->_time_begin = 0;
  this->_time_end = 0;
}
